<template>
	<view class="page">
		<view class="title">
			<view class="title-txt">{{info.homeworkName}}</view>
		</view>
		<rich-text :nodes="richTxt"></rich-text>
	</view>
</template>

<script>
	import HomeworkService from '@/services/homeworkService.js'
	const homeworkService = new HomeworkService();
	import {adjustRichImg} from '@/utils/index.js'
	export default {
		data() {
			return {
				lessonId: '',
				info: {},
				richTxt:''
			}
		},
		onLoad(query) {
			this.lessonId = query.lessonId;
			this.loadData();
		},
		methods: {
			loadData() {
				const params = {
					lessonId:this.lessonId
				}
				homeworkService.homeworkInfo(params).then(res=>{
					if(res.success){
						this.info = res.result;
						this.richTxt = adjustRichImg(res.result.offlineHomework)
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.page {
		padding: 0 20upx;
	}

	.title {
		border-bottom: 2upx solid #dddddd;
		padding: 40upx 0;
		margin-bottom: 20upx;

		&-txt {
			font-size: 30upx;
			color: #333333;
		}

		&-time {
			font-size: 24upx;
			color: #999999;
			margin-top: 18upx;
		}
	}
</style>
